package pri.jz.keeper.ui.view.content.home

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.google.accompanist.insets.statusBarsHeight
import pri.jz.keeper.ui.theme.MainThemeColor
import pri.jz.keeper.ui.content.home.HomeViewModel
import androidx.lifecycle.viewmodel.compose.viewModel
import pri.jz.keeper.jui.JSearchBar

/**
 *Author by: JZ
 *Email: 2451756617@qq.com
 *PS:
 */
@Composable
fun HomeTopBar(viewModel: HomeViewModel = viewModel()) {
    Column(
        modifier = Modifier.fillMaxWidth()
    ) {
        Spacer(modifier = Modifier.fillMaxWidth().statusBarsHeight().background(MainThemeColor))
        HomeTopBarView(viewModel)
    }
}

@Composable
private fun HomeTopBarView(viewModel: HomeViewModel) {
    Row(
        modifier = Modifier.fillMaxWidth()
            .background(MainThemeColor)
    ) {
        JSearchBar(Modifier.fillMaxWidth(0.7f)) {

        }
    }
}
